package com.neuedu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.neuedu.mapper.ConstantItemMapper;
import com.neuedu.pojo.ConstantItem;
import com.neuedu.service.IConstantItemService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 常数项 服务实现类
 * </p>
 *
 * @author liuyong
 * @since 2020-09-17
 */
@Service
public class ConstantItemServiceImpl extends ServiceImpl<ConstantItemMapper, ConstantItem> implements IConstantItemService {
	@Resource
	private ConstantItemMapper constantItemMapper;

	@Override
	public List<Map<String, Object>> getListByTypeId(int id) {
		QueryWrapper<ConstantItem> wrapper = new QueryWrapper<>();
		wrapper.eq("active", 1).eq("type_id",id);
		wrapper.orderByAsc("sort");
		return constantItemMapper.getListByTypeId(wrapper) ;
	}
}
